Activity Diagram for the Restaurant Management System

Create some activity diagrams for the restaurant management system problem.

Activities diagrams are a great way to visualize the flow of messages from one activity to the other in the system. There can be different activity diagrams that we can create for our restaurant management system. In this lesson, we’ll create activity diagrams for the following two activities:

  • Place the order

  • Activity challenge: How to cancel the order

Place the order#

The following are the states and actions that will be involved in this activity diagram.

States#

Initial state: A guest arrives at the restaurant and asks for a table.

Final state: The guest successfully placed a food order.

Actions#

The guest arrives at the restaurant reception and asks for a table. The receptionist checks for table availability. The guest will sit at the table if the table is available. If the table is unavailable, the guest will wait for a free table.

The waiter will appear with the menu when a guest sits at the table. The guest will decide to order from the menu. The waiter will send it to the kitchen.

Based on the order above, the activity diagram of the table booking and the food order are shown below:

The activity diagram for placing the order
The activity diagram for placing the order

Activity challenge: Cancel the order#

Let’s create an activity diagram for a guest who wants to cancel their order.

A skeleton of the activity diagram is given below.

The activity diagram for order cancelation
The activity diagram for order cancelation

Notice that the actions in the diagram above are numbered from 1 to 6. The slots shown below represent the activities, and the arrows represent the flow from one activity to the other. Can you rearrange the slots below in the correct order they should appear in the activity diagram above?

Note: If you unsure, click the “Show Solution” button to check the correct answer.

Fill in the missing slots with the correct actions for a guest who wants to cancel the order.

The guest decides on the order items

The waiter places the order

The guest has to leave due to an emergency

The guest asks the waiter to cancel the order

The waiter checks the order status

Is the order ready?

The waiter cancels the order

The waiter packs the order

The guest performs the payment

The guest leaves the restaurant


Alternatively, click the "Show complete diagram" button below to see the complete activity diagram.

We've looked at some of the activity diagrams of our restaurant management system. In the next lesson, we will present the code for our designed classes in some of the most popular languages.

Sequence Diagram for the Restaurant Management System

Code for the Restaurant Management System